#include<bits/stdc++.h>
using namespace std;

const int Maxn = 1e5 + 5;

int n;
int r[Maxn];

struct node
{
    int num = 0;
    int pre = 0;
} q[Maxn];

inline void read(int &x)
{
    x = 0; int f = 1;
    char ch = getchar();
    while(!isdigit(ch)) f = ch == '-' ? -1 : f , ch = getchar();
    while( isdigit(ch)) x = (x << 1) + (x << 3) + (ch ^ 48) , ch = getchar();
    x *= f;
}

int main()
{
    freopen("duel.in","r",stdin);
    freopen("duel.out","w",stdout);
    read(n);
    for (int i = 1; i <= n; ++i)
        read(r[i]);
    sort(r + 1 , r + 1 + n);
    int len = 0;
    for (int i = 1; i <= n; ++i)
    {
        if(r[i] == q[len].num) q[len].pre++;
        else q[++len] = (node){ r[i] , 1 };
    }
    int sum = q[1].pre , ans = 0;
    for (int i = 2; i <= len; ++i)
    {
        if(sum <= q[i].pre) sum = 2 * q[i].pre - sum , ans += sum;
        else ans += q[i].pre;
    }
    cout << n - ans <<endl;
    return 0;
}
